module {
    func.func @SHA1_OP(%arg0: !llvm.ptr, %arg1: i32, %arg2: !llvm.ptr) {
    %0 = llvm.load %arg0 : !llvm.ptr -> !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)>
    %1 = llvm.load %arg2 : !llvm.ptr -> !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)>
    %2 = builtin.unrealized_conversion_cast %0 : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> to memref<?xi8>
    %3 = builtin.unrealized_conversion_cast %1 : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> to memref<?xi8>
    "crypto.sha1"(%2, %arg1, %3) : (memref<?xi8>, i32, memref<?xi8>) -> ()
    return
    }


    func.func @SHA1_CRACK_OP(%hash: !llvm.ptr, %candidate: !llvm.ptr, %num: i32, %len: i32, %out: !llvm.ptr) {
     %0 = llvm.load %hash : !llvm.ptr -> !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)>
     %1 = llvm.load %candidate : !llvm.ptr -> !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)>
     %2 = llvm.load %out : !llvm.ptr -> !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)>
     %3 = builtin.unrealized_conversion_cast %0 : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> to memref<?xi8>
     %4 = builtin.unrealized_conversion_cast %1 : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> to memref<?xi8>
     %5 = builtin.unrealized_conversion_cast %2 : !llvm.struct<(ptr, ptr, i64, array<1 x i64>, array<1 x i64>)> to memref<?xi8>
     %res = "crypto.sha1.crack" (%3, %4, %num, %len) : (memref<?xi8>, memref<?xi8>, i32, i32) -> (memref<?xi8>)
     memref.copy %res, %5 : memref<?xi8> to memref<?xi8>
     return
    }
}